home *** CD-ROM | disk | FTP | other *** search
- /*
- param line
-
- Draw a cut line
- Modify l: the lenght of the step on the line
-
- */
-
- address 'rexx_TVPaint'
-
- parse ARG m x1 y1 x2 y2 b
- if(m~='Line')then
- do
- tv_warn 'I need LINE parameters'
- exit
- end
-
-
- l=20
-
-
- tv_UpdateUndo
- x=x1
- y=y1
-
- iy=1
- dy=y2-y1
- if (dy<0) then
- do
- dy=-dy
- iy=-1
- end
-
-
- ix=1
- dx=x2-x1
- if (dx<0) then
- do
- dx=-dx
- ix=-1
- end
-
- xb=x
- yb=y
- xa=x
- ya=y
- c=1
-
- if (dx>dy) then
- do
- d=dx
- do while (x~==x2)
-
- x=x+ix
- d=d-dy
-
- if (d<0) then
- do
- y=y+iy
- d=d+dx
- end
-
- if((x%l)*l == x) then
- do
- if (c==1) then
- do
- tv_line xb yb x y b
- c=0
- end
- else c=1
-
- xb=x
- yb=y
- end
- end
- end
- else
- do
- d=dy
- do while (y ~==y2)
-
- y=y+iy
- d=d-dx
-
- if (d<0) then
- do
- x=x+ix
- d=d+dy
- end
- if((y%l)*l == y) then
- do
-
- if (c==1) then
- do
- tv_line xb yb x y b
- c=0
- end
- else c=1
-
- xb=x
- yb=y
- end
- end
- end
-
-
-